/**
 * meta 可配置参数
 * @param {boolean} icon 页面icon
 * @param {boolean} keepAlive 是否缓存页面
 * @param {string} title 页面标题
 */
export default [
  {
    path: '/',
    redirect: '/login'
  },
  {
    path: '/login',
    name: 'login',
    component: () => import('@v/base/login/login.vue'),
    meta: {
      icon: '',
      keepAlive: false,
      title: '登录SNAKE-API'
    }
  },
  {
    path: '/field',
    component: () => import('@/views/layout/field/field.vue'),
    // redirect: '/home/work',
    children: [
      {
        path: '/register',
        name: 'register',
        component: () => import('@v/base/register/register.vue'),
        meta: {
          icon: '',
          keepAlive: false,
          title: '注册'
        }
      },
      {
        path: 'team-add',
        name: 'team-add',
        component: () => import('@v/team/team-add/team-add.vue'),
        meta: {
          icon: '',
          keepAlive: false,
          title: '新建团队'
        }
      }
    ]
  },
  {
    path: '/home',
    component: () => import('@/views/layout/home/home.vue'),
    redirect: '/home/work',
    children: [
      {
        path: 'work',
        name: 'work',
        component: () => import('@/views/work/work-list/work-list.vue'),
        meta: {
          keepAlive: true,
          title: '工作台',
          requiresAuth: true
        }
      },
      {
        path: 'demand',
        name: 'demand',
        component: () => import('@/views/demand/demand-list/demand-list.vue'),
        meta: {
          keepAlive: true,
          title: '需求',
          requiresAuth: true
        }
      },
      {
        path: 'demand-interface-detail/:id',
        name: 'demand-interface-detail',
        component: () =>
          import(
            '@/views/demand/demand-interface-detail/demand-interface-detail.vue'
          ),
        meta: {
          keepAlive: true,
          title: '需求接口详情',
          requiresAuth: true
        }
      },
      {
        path: 'interface-list',
        name: 'interface-list',
        component: () =>
          import('@/views/interface/interface-list/interface-list.vue'),
        meta: {
          keepAlive: true,
          title: '接口存档',
          requiresAuth: true
        }
      },
      {
        path: 'basic-data',
        name: 'basic-data',
        component: () => import('@/views/base/basic-data/basic-data.vue'),
        meta: {
          keepAlive: false,
          title: '基础数据维护',
          requiresAuth: true
        }
      },
      {
        path: 'personal-data',
        name: 'personal-data',
        component: () => import('@/views/base/personal-data/personal-data.vue'),
        meta: {
          keepAlive: false,
          title: '个人资料',
          requiresAuth: true
        }
      },
      {
        path: 'project-list',
        name: 'project-list',
        component: () => import('@/views/base/project-list/project-list.vue'),
        meta: {
          keepAlive: false,
          title: '项目列表',
          requiresAuth: true
        }
      },
      {
        path: 'team',
        name: 'team',
        component: () => import('@/views/team/team-list/team-list.vue'),
        meta: {
          keepAlive: false,
          title: '团队列表',
          requiresAuth: true
        }
      },
      {
        path: 'team-member-list',
        name: 'team-member-list',
        component: () =>
          import('@/views/team/team-member-list/team-member-list.vue'),
        meta: {
          keepAlive: false,
          title: '团队成员列表',
          requiresAuth: true
        }
      }
    ]
  },
  {
    // 这里匹配404链接 需要放在路由的最后一个位置
    path: '*',
    component: () => import('@/views/404/404.vue'),
    meta: {
      icon: '',
      keepAlive: true,
      title: '找不到页面'
    }
  }
];
